package com.yljk.yljkproject.ui;

import android.content.Intent;
import android.os.Bundle;

import com.alibaba.android.arouter.launcher.ARouter;
import com.leaf.library.StatusBarUtil;
import com.umeng.message.UmengNotifyClickActivity;
import com.yljk.live.common.utils.MediaCountyManager;
import com.yljk.servicemanager.constants.RouterApi;

import org.android.agoo.common.AgooConstants;
import org.json.JSONObject;

/**
 * @author: cenjunlei
 * @date: 2021/8/12 21:14
 * @desc: 友盟第三方渠道信息接收
 */
public class MfrMessageActivity extends UmengNotifyClickActivity {

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        StatusBarUtil.setTransparentForWindow(this);
        ARouter.getInstance().build(RouterApi.MAIN_ACTIVITY).navigation();
    }

    @Override
    public void onMessage(Intent intent) {
        super.onMessage(intent);
        String body = intent.getStringExtra(AgooConstants.MESSAGE_BODY);
        try {
            JSONObject jsonObject = new JSONObject(body);
            JSONObject extra = jsonObject.optJSONObject("extra");
            String scheme = extra.optString("scheme");
//            McPushManager.getInstance().click(scheme);
            MediaCountyManager.getInstance().pageClick(scheme);
        } catch (Exception e) {
            e.printStackTrace();
        }

        finish();


    }
}